<?php
/**
 * Created by PhpStorm.
 * User: xi
 * Date: 2020-05-02
 * Time: 16:54
 */

namespace app\api\service;


class RankService
{

    public static $nameConfig = [
        "1" => "U粉丝",
        "2" => 'U品推荐官',
        "3" => 'U品代言人',
        "4" => 'U品合伙人',

    ];


    /**
     * @var array 信用卡
     */
    public static $cardProfitConfig = [
        "0" => 0, //vip
        "1" => 1,//钻石
        "2" => 1.2,//一星钻石
        "3" => 1.4,//二星钻石
        "4" => 1.6,//三星钻石
        "5" => 1.8,//市场总监
        "6" => 2.0,//一星总监
        "7" => 2.2,//二星总监
        "8" => 2.4,//三星总监
        "9" => 2.6,//四星总监
        "10" => 2.8,//五星总监
        "11" => 3,//信呗创始人

    ];

    /**
     * 钻石VIP推荐奖励
     */
    public static $vipConfig = [
        "1" => 0, //U粉丝
        "2" => 0,//U品推荐官
        "3" => 20,//U品代言人
        "4" => 30,//U品合伙人
    ];

    /**
     * 笔数奖励
     */
    public static $countConfig = [
        "0" => 0, //vip
        "1" => 0,//钻石
        "2" => 0.1,//一星钻石
        "3" => 0.2,//二星钻石
        "4" => 0.3,//三星钻石
        "5" => 0.6,//市场总监
        "6" => 0.7,//一星总监
        "7" => 0.8,//二星总监
        "8" => 0.9,//三星总监
        "9" => 1,//四星总监
        "10" => 1.1,//五星总监
        "11" => 1.2,//信呗创始人

    ];


    /**
     * @var array
     * 风控花呗
     */
    public static $fkprofitConfig = [
        "0" => 0, //vip
        "1" => 20,//钻石
        "2" => 25,//一星钻石
        "3" => 30,//二星钻石
        "4" => 35,//三星钻石
        "5" => 60,//市场总监
        "6" => 70,//一星总监
        "7" => 80,//二星总监
        "8" => 90,//三星总监
        "9" => 100,//四星总监
        "10" => 110,//五星总监
        "11" => 120,//信呗创始人
    ];



    /**
     * @var array
     * 白条小额
     */
    public static $jdSysprofitConfig = [
        "0" => 0, //vip
        "1" => 20,//钻石
        "2" => 25,//一星钻石
        "3" => 30,//二星钻石
        "4" => 35,//三星钻石
        "5" => 60,//市场总监
        "6" => 70,//一星总监
        "7" => 80,//二星总监
        "8" => 90,//三星总监
        "9" => 100,//四星总监
        "10" => 110,//五星总监
        "11" => 120,//信呗创始人
    ];

    /**
     * @var array 花呗
     */
    public static $profitConfig = [
        "0" => 0,
        "1" => 10,
        "2" => 11,
        "3" => 12,
        "4" => 13,
        "5" => 14,
        "6" => 15,
        "7" => 16,
        "8" => 14,
        "9" => 18,
        "10" => 19,
        "11" => 20,
    ];




    public static $hbCountConfig = [
        "0" => 0, //vip
        "1" => 0.5,//钻石
        "2" => 0.6,//一星钻石
        "3" => 0.7,//二星钻石
        "4" => 0.8,//三星钻石
        "5" => 0.9,//市场总监
        "6" => 1.0,//一星总监
        "7" => 1.1,//二星总监
        "8" => 1.2,//三星总监
        "9" => 1.3,//四星总监
        "10" => 1.4,//五星总监
        "11" => 1.5,//信呗创始人

    ];





    public function getGroup3List($list){

        $isFindGroup3 = -1;
        $keyGroup3 = 0;
        $valueGroup3 = '';
        $listGroup3 = [];
        $tmp = '';
        foreach ($list as $key => $val) {

            if ($isFindGroup3 == 1)
                break;
            if ($valueGroup3 != '' && $val['group_id'] == 3 && ($keyGroup3 + 1) == $key) {
                $listGroup3[] = $val;
                $tmp.="==1===";
            }
            if ($valueGroup3 != '' && $val['group_id'] != 3) {
                $isFindGroup3 = 1;
                break;
            }
            if ($val['group_id'] == 3) {
                $valueGroup3 = $val;
                $keyGroup3 = $key;

            }

        }
        return $listGroup3;
    }

    public function getGroup4List($list){

        $isFindGroup3 = -1;
        $keyGroup3 = 0;
        $valueGroup3 = '';
        $listGroup3 = [];
        $tmp = '';
        foreach ($list as $key => $val) {

            if ($isFindGroup3 == 1)
                break;
            if ($valueGroup3 != '' && $val['group_id'] == 4 && ($keyGroup3 + 1) == $key) {
                $listGroup3[] = $val;
                $tmp.="==1===";
            }
            if ($valueGroup3 != '' && $val['group_id'] != 4) {
                $isFindGroup3 = 1;
                break;
            }
            if ($val['group_id'] == 4) {
                $valueGroup3 = $val;
                $keyGroup3 = $key;

            }

        }
        return $listGroup3;
    }





}